<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?><?php } ?> <?php wp_title(); ?> </title>
<meta name="description" content="Today's breaking news enhanced by historical context." />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
<!-- Styles  -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/print.css" type="text/css" media="print" />
<!--[if IE]><link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ie.css" type="text/css" media="screen, projection" /><![endif]-->
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
global $wp_query;
$thePostID = $wp_query->post->ID;
if( has_post_thumbnail( $thePostID )){
    $thumb_id = get_post_thumbnail_id( $thePostID );
    $image = wp_get_attachment_image_src( $thumb_id );
    echo '<meta property="og:image" content="'.$image[0].'" />';
} ?>
<?php wp_head();
	$options = get_option('f8_theme_options');
?>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-29549784-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>
<!-- USE THEIR CONFLICT -->
<body <?php body_class(); ?>>
<div class="container">
<!-- pageback contains midpage.png for the paper background, toppage contains the top, bottom page contains the bottom -->
<div id="pageback">
<div class="container-inner">

<!-- Begin Masthead -->
<div id="masthead" class="clearfix">
	<a href="<?php echo get_option('home'); ?>/" title="Home"><img id="logo" src="/wp-content/themes/breaking-history/images/chainlogo.png" alt="Breaking History logo"></a>
	<!-- Begin rss (MOVED INSIDE)-->
	<div id="topbar">
		<div id="about"><a href="http://breaking-history.com/about/"><p>about</p></a></div>
		<div id="featured"><a href="http://breaking-history.com/category/featured/"><p>featured</p></a></div>
		<div id="searchbox">
			<?php get_search_form( $echo ); ?>
		</div>
	</div>
	<div id="inside-subscribe">
		<a href="https://twitter.com/#!/BreakHistory"><img id="twitter" src="/wp-content/themes/breaking-history/images/twittericon.png" alt="Twitter"></a>
		<a href="https://www.facebook.com/breakinghistory" target=_blank><img id="facebook" src="/wp-content/themes/breaking-history/images/facebookicon.png" alt="Facebook"></a>
		<a href="mailto:?Subject=Check out Breaking History!&Body=Breaking History just blew my mind and I'd like to share it with you.  Check out http://breaking-history.com for today's news in context. "><img id="mail" src="/wp-content/themes/breaking-history/images/mailicon.png" alt="Mail"></a>
	</div>
	
	<div class="clear"></div>
    <h1 id="sitename" class="left"><a href="<?php echo get_option('home'); ?>/" title="Home"><?php bloginfo('name'); ?></a> <span class="description"><?php bloginfo('description'); ?></span><span class="contact"><?php if ( $options['phone'] != '' ) { ?><?php echo $options['phone']; ?><br /><?php } if ( $options['email'] != '' ) { ?><a href="mailto:<?php echo $options['email']; ?>"><?php echo $options['email']; ?></a><?php } ?></span></h1>
</div>

<?php
	$slideshow = $options['selectinput'];
	// Only show this is the Single Header Image is selected or if no option is set
	if ( $slideshow == 1 || !$slideshow ) {
		// Check if this is a post or page, if it has a thumbnail, and if it's a big one
		if ( is_singular() &&
				has_post_thumbnail( $post->ID ) &&
				( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( '950', '425' ) ) ) &&
				$image[1] >= HEADER_IMAGE_WIDTH ) :
			// Houston, we have a new header image!
			echo get_the_post_thumbnail( $post->ID, '950x425' );
		else : ?>
			<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="<?php bloginfo('name'); ?>" class="headerimg" />
	<?php endif; 
	} // End only show if Single Header Image is selected
?>


<?php
	if ( is_home() && $paged < 1 ) {
		get_template_part( 'slideshow' );
	}
?>